//
//  SAShopAllocateFooterView.m
//  saasRetail
//
//  Created by 黄志刚 on 2022/4/20.
//

#import "SAShopAllocateFooterView.h"

@interface SAShopAllocateFooterView ()

@property (nonatomic, strong) UIButton *addBtn;
@property (nonatomic, strong) UIButton *scanBtn;

@end

@implementation SAShopAllocateFooterView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
        [self initUI];
    }
    return self;
}

-(void)clickedAddBtn {
    !self.addBlock ?: self.addBlock();
}

-(void)clickedScanBtn {
    !self.scanBlock ?: self.scanBlock();
}

-(void)initUI {
    
    self.contentView.backgroundColor = kBgColor;
    
    UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [addBtn setImage:[UIImage imageNamed:@"Sale_Add2"] forState:UIControlStateNormal];
    addBtn.frame = CGRectMake(kScreenWidth - kScaleNum(125), 0, kScaleNum(45), kScaleNum(65));
    [addBtn addTarget:self action:@selector(clickedAddBtn) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:addBtn];
    self.addBtn = addBtn;
    
    UIButton *scanBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [scanBtn setImage:[UIImage imageNamed:@"Sale_scan2"] forState:UIControlStateNormal];
    scanBtn.frame = CGRectMake(kScaleNum(80), 0, kScaleNum(45), kScaleNum(65));
    [scanBtn addTarget:self action:@selector(clickedScanBtn) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:scanBtn];
    self.scanBtn = scanBtn;
}

@end
